package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.NewsDao;
import com.cn.wanxi.dao.impl.NewsImpl;
import com.cn.wanxi.model.NewsModel;
import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.NewsService;

import java.util.List;

public class NewsServiceImpl implements NewsService {
    @Override
    public List<NewsModel> getNewsModelListForHomePage() {
        NewsDao newsDao = new NewsImpl();
        return newsDao.getNewsModelListForHomePage();
    }

    @Override
    public ResultModel findByIdForFront(NewsModel newsModel) {
        NewsDao newsDao = new NewsImpl();
        return ResultModel.getResultModel("", 0, 1, newsDao.findByIdForFront(newsModel));
    }

    @Override
    public ResultModel add(NewsModel newsModel) {
        return null;
    }

    @Override
    public ResultModel update(NewsModel newsModel) {
        return null;
    }

    @Override
    public ResultModel delete(NewsModel newsModel) {
        return null;
    }

    @Override
    public ResultModel findAll(NewsModel newsModel) {
        return null;
    }

    @Override
    public ResultModel findById(NewsModel newsModel) {
        NewsDao newsDao = new NewsImpl();
        return ResultModel.getResultModel("success", 0, 1, newsDao.findById(newsModel));
    }

    @Override
    public ResultModel getCount(NewsModel newsModel) {
        return null;
    }

    @Override
    public ResultModel changeEnable(NewsModel newsModel) {
        return null;
    }
}
